<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./css/worth.css">
    <link rel="stylesheet" href="./font/font5/iconfont.css">
    <title>Document</title>
</head>
<body>
    <div class="header">
        <div class="top">
            <p onclick="back()"></p>
            <p>我的当当</p>
            <p onclick="show()"></p>
        </div>
        <div class="hide">
            <ul>
                <li>
                    <a href="">
                        <i class="iconfont icon-shouye"></i>
                        <p>首页</p>
                    </a>
                </li>
                <li>
                    <a href="">
                        <i class="iconfont icon-fenlei"></i>
                        <p>分类</p>
                    </a>
                </li>
                <li>
                    <a href="./worth.html">
                        <i class="iconfont icon-dai"></i>
                        <p>值得买</p>
                    </a>
                </li>
                <li>
                    <a href="./car.html">
                        <i class="iconfont icon-che"></i>
                        <p>购物车</p>
                    </a>
                </li>
                <li>
                    <a href="./main.html">
                        <i class="iconfont icon-wode"></i>
                        <p>我的当当</p>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <ul class="list">
        <li><img src="https://img61.ddimg.cn/2018/8/25/20180825153505715.png" alt=""></li>
        <li><img src="https://img61.ddimg.cn/2018/8/25/2018082515383576435.png" alt=""></li>
        <li><img src="https://img61.ddimg.cn/2018/8/25/2018082515395286917.png" alt=""></li>
        <li><img src="https://img63.ddimg.cn/2018/8/31/2018083116044590576.png" alt=""></li>
        <li><img src="https://img63.ddimg.cn/upload_img/00660/h5/ddpp-1537350824.png" alt=""></li>
        <li><img src="https://img62.ddimg.cn/2018/8/31/2018083116363087335.png" alt=""></li>
        <li><img src="https://img62.ddimg.cn/2018/8/31/2018083116355544875.png" alt=""></li>
        <li><img src="https://img61.ddimg.cn/2018/8/31/2018083116365438226.png" alt=""></li>
        <li><img src="https://img62.ddimg.cn/2018/8/31/2018083116373380162.png" alt=""></li>
        <li><img src="https://img60.ddimg.cn/upload_img/00782/h5/coupon-1537505152.png" alt=""></li>
    </ul>
    <div class="login">
        <div class="login-left">
            
        </div>
        <div class="login-right">
            <p>TOP</p>
        </div>
    </div>
    <div class="last">
        <p>
            <span>提建议</span>
            <span>电脑版</span>
            <span>帮&nbsp;助</span>
        </p>
        <p>Copyright ©2018 北京当当网信息技术有限公司</p>
        <p>京ICP备17043473号-1</p>
        <p>北京市朝阳区东四环北路2号上东公园里4层东塔&5层，100016</p>
    </div>
    <div class="end">
        <ul>
            <li>
                <a href="">
                    <i class="iconfont icon-shouye"></i>
                    <p>首页</p>
                </a>
            </li>
            <li>
                <a href="">
                    <i class="iconfont icon-fenlei"></i>
                    <p>分类</p>
                </a>
            </li>
            <li>
                <a href="./worth.html">
                    <i class="iconfont icon-dai"></i>
                    <p>值得买</p>
                </a>
            </li>
            <li>
                <a href="./car.html">
                    <i class="iconfont icon-che"></i>
                    <p>购物车</p>
                </a>
            </li>
            <li>
                <a href="./main.html">
                    <i class="iconfont icon-wode"></i>
                    <p>我的当当</p>
                </a>
            </li>
        </ul>
    </div>
</body>
<script src="./js/reset-5.js"></script>
<script>
    function show(){
        var top=document.querySelector(".top")
        var header=document.querySelector(".header")
        top.lastElementChild.classList.toggle("on") 
        header.classList.toggle("headers") 
    }
    function back(){
        window.history.back()
    }
    function login(){
        var name=prompt("请输入用户名")
        var pwd=prompt("请输入密码")
        if(name=="zhangsan"&&pwd=="123456"){
            alert("登录成功")
            localStorage.setItem("login",1)
            localStorage.setItem("name",name)
            localStorage.setItem("pwd",pwd)
        }else{
            alert("登录失败,请重新登陆。")
        }
        var asd=document.querySelector(".login-left")
        if(localStorage.getItem("login")==null){
            asd.innerHTML=``
            asd.innerHTML+=`
                <p onclick='login()'>登陆</p>
                <p onclick='login()'>注册</p>
            `
        }else{
            asd.innerHTML=``
            asd.innerHTML+=`
                <p onclick='quit()'>退出</p>
            `
        }
    }
    var asd=document.querySelector(".login-left")
        if(localStorage.getItem("login")==null){
            asd.innerHTML+=`
                <p onclick='login()'>登陆</p>
                <p onclick='login()'>注册</p>
            `
        }else{
            asd.innerHTML=``
            asd.innerHTML+=`
                <p onclick='quit()'>退出</p>
            `
        }

    function quit(){
        localStorage.clear()
        asd.innerHTML=``
        asd.innerHTML+=`
                <p onclick='login()'>登陆</p>
                <p onclick='login()'>注册</p>
        `
    }
</script>
</html>